import React from 'react'
// ===================================================================== Temp
import TableModal from '#cpt/temp/TableModal'
// ===================================================================== Dclare
const { $fn } = window
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		selectedKeys:[],
		// 搜索表单列表
		forms : [
			{ label: '权限名称',		name: 'perm_name' }
		]
	}
	
	model = {}
	
	open = (uuid) => {
		this.modal.open()
		this.query = { perm_type: 903 }
		this.uuid = uuid 
		
		this.fetch()
	}

	// paging
	fetch = () => $fn.fetch.call(this, 'permission/index')
	
	// 表单
	cols = [
		{ title: '权限名称', 		dataIndex: 'perm_name' },
		{ title: '权限描述', 		dataIndex: 'perm_desc' },
		{ title: '权限代码', 		dataIndex: 'perm_code' }
	]
	
	render(){
		return TableModal.call(this,{ title:'添加权限', width:'60%', height:'80%', api:'conf-scene-permission/add',
					getSubmit: keys => ({ scene_uuid: this.uuid, permission_uuids: keys })
				})
	}
}

export default Index